//
//  ZBLEDataModel.h
//  ZRGP
//
//  Created by Jun on 2020/10/9.
//  Copyright © 2020 HWD. All rights reserved.
//

#import <Foundation/Foundation.h>

//指令大类
typedef NS_ENUM(NSUInteger, bStateType){
    //放空状态
    bEmptyState = 0,
    //充满状态
    bFullState = 1,
    //放电或静置状态
    bSilenceState = 2,
    //剩余时间告警
    bReTimeState = 3,
    //剩余容量告警
    bReVolumeState= 4,
    //终止放电告警
    bStopDischargeState = 5,
    //高温告警
    bHighTempState = 6,
    //终止充电告警
    bStopChargeState = 7,
    //过充告警
    bOverChargeState = 8
};

NS_ASSUME_NONNULL_BEGIN

@interface ZBLEDataModel : NSObject
//数据包编号
@property (nonatomic ,assign) NSInteger ackNum;
//电池组电压
@property (nonatomic ,assign) NSInteger bVoltage;
//电池电流
@property (nonatomic ,assign) int bCurrent;
//电池温度
@property (nonatomic ,assign) NSInteger bTemp;
//SOC
@property (nonatomic ,assign) NSInteger bSoc;
//SOH
@property (nonatomic ,assign) NSInteger bSoh;
//循环次数
@property (nonatomic ,assign) NSInteger bCycleNum;
//剩余容量
@property (nonatomic ,assign) NSInteger bDumpVolume;
//充满容量
@property (nonatomic ,assign) NSInteger bFullVolume;
//放空时间
@property (nonatomic ,assign) NSInteger bEmptyTime;
//充满时间
@property (nonatomic ,assign) NSInteger bFullTime;
//电池温度
@property (nonatomic ,assign) NSInteger bTemp2;
//单体电压1
@property (nonatomic ,assign) NSInteger cellVoltage1;
//单体电压2
@property (nonatomic ,assign) NSInteger cellVoltage2;
//单体电压3
@property (nonatomic ,assign) NSInteger cellVoltage3;
//单体电压4
@property (nonatomic ,assign) NSInteger cellVoltage4;
//电池状态
@property (nonatomic ,assign) bStateType bState;

//电池状态位1 充电过流 Charge overcurrentprotect
@property (nonatomic ,assign) NSInteger bState_01;

//电池状态位2 放电过流Discharge overcurrentprotect
@property (nonatomic ,assign) NSInteger bState_02;

//电池状态位3 短路故障Short Circuit Fault.
@property (nonatomic ,assign) NSInteger bState_03;

//电池状态位4 采样失效Sample fault
@property (nonatomic ,assign) NSInteger bState_04;

//电池状态位5 放空Fully Discharged
@property (nonatomic ,assign) NSInteger bState_05;

//电池状态位6 充满Fully Charged
@property (nonatomic ,assign) NSInteger bState_06;

//电池状态位7 放电或静置Discharging or Relax
@property (nonatomic ,assign) NSInteger bState_07;

//电池状态位8 Mos管故障Mos fault
@property (nonatomic ,assign) NSInteger bState_08;

//电池状态位9 剩余时间告警Remaining Time Alarm
@property (nonatomic ,assign) NSInteger bState_09;

//电池状态位10 剩余容量告警Remaining Capacity Alarm
@property (nonatomic ,assign) NSInteger bState_10;

//电池状态位11 NTC失效NTC Fault
@property (nonatomic ,assign) NSInteger bState_11;

//电池状态位12 终止放电告警Terminate Discharge Alarm
@property (nonatomic ,assign) NSInteger bState_12;

//电池状态位13 高温告警Overtemperature Alarm
@property (nonatomic ,assign) NSInteger bState_13;

//电池状态位14 低温告警Lowtemperature Alarm
@property (nonatomic ,assign) NSInteger bState_14;

//电池状态位15 终止充电告警Terminate Charge Alarm
@property (nonatomic ,assign) NSInteger bState_15;

//电池状态位16 过充告警Overcharged Alarm
@property (nonatomic ,assign) NSInteger bState_16;


- (instancetype)initWith:(NSData *)data;


@end

NS_ASSUME_NONNULL_END
